using System;
using System.Collections.Generic;
using System.Text;

using System.Windows.Media;
using System.Windows;
using System.Windows.Controls;
namespace Orbifold.Trefoil
{
    /// <summary>
    /// Tool that allows yout to change the color of the shapes.
    /// </summary>
    class ChangeColorTool : ToolBase
    {
        public override void OnExecute(object sender, System.Windows.Input.ExecutedRoutedEventArgs e)
        {           
           
        }

        public ChangeColorTool()
            : base("Change color")
        {

        }

        #region ChangeColorCommand
        /// <summary>
        /// Change color ICommand encapsulation. Note that you need to have a Connectable in order to change the color. The class will not raise an exception however if applied to something else.
        /// </summary>
        class ChangeColorCommand : ICommand
        {
            #region Fields
            private Color mOldColor, mNewColor;

            #region Properties
            /// <summary>
            /// Gets or sets the new color.
            /// </summary>
            /// <value>The new color.</value>
            public Color NewColor
            {
                get { return mNewColor; }
                set { mNewColor = value; }
            }

            /// <summary>
            /// Gets or sets the old color.
            /// </summary>
            /// <value>The old color.</value>
            public Color OldColor
            {
                get { return mOldColor; }
                set { mOldColor = value; }
            }
            #endregion
            private UIElement mShape;
            #endregion

            #region Constructor
            ///<summary>
            ///Default constructor
            ///</summary>
            public ChangeColorCommand(UIElement shape, Color newColor)
            {
                if (shape == null)
                    throw new ArgumentException("Changing the color of 'null' is not possible.");
                mShape = shape;
                
                mNewColor = newColor;
            }
            #endregion


            #region ICommand Members

            public void Undo()
            {
                
            }

            public void Redo()
            {
            
            }

            public string Text
            {
                get
                {
                    return "Change color";
                }
                set
                {
                    throw new Exception("The method or operation is not implemented.");
                }
            }

            #endregion
        }
        #endregion
    }
    
}
